<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="Dashboard">
    <meta name="keyword" content="Dashboard, Bootstrap, Admin, Template, Theme, Responsive, Fluid, Retina">
    <title>码客思</title>
    <link href="${rc.contextPath}/assets/css/bootstrap.css" rel="stylesheet">
    <link href="${rc.contextPath}/assets/font-awesome/css/font-awesome.css" rel="stylesheet" />
    <link href="${rc.contextPath}/assets/css/style.css" rel="stylesheet">
    <link href="${rc.contextPath}/assets/css/style-responsive.css" rel="stylesheet">
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script src="${rc.contextPath}/assets/js/jquery.js"></script>
    <!-- 验证框架 -->
	<script type="text/javascript" src="${rc.contextPath}/bootstrap/bootstrap.min.js"></script>
	<script type="text/javascript" src="${rc.contextPath}/bootstrap/bootstrap-modal.js"></script>
	<script type="text/javascript" src="${rc.contextPath}/bootstrap/bootstrap-modalmanager.js"></script>
	<script type="text/javascript" src="${rc.contextPath}/bootstrap/bootstrap-validation.js"></script>
    <script src="${rc.contextPath}/assets/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="${rc.contextPath}/assets/js/jquery.backstretch.min.js"></script>
  	<!-- 弹出JS -->
	<script type="text/javascript" src="${rc.contextPath}/layer/layer.js"></script>
	<script type="text/javascript">
	function sublogin(){
		var tel = $("#tel").val();
		var password = $("#password").val();
		if(tel == ""){
			layer.msg('请输入邮箱或者手机号码');
			return false;
		}
		if(password == ""){
			layer.msg('请输密码');
			return false;
		}
		var flag =$("#beanform").validationAjax();
		if(flag){
			$.ajax({
	            cache: true,
	            type: "POST",
	            url:"${rc.contextPath}/loginadd",
	            data:$('#beanform').serialize(),// 你的formid
	            async: false,
	            error: function(request) {
	            	layer.msg("系统错误");
	            },
	            success: function(data) {
	            	if("success" == data){
	            		layer.msg("登录成功！");
	            		location.href="${rc.contextPath}/indexs.html";
	            	}else{
	            		layer.msg("用户名或者密码错误！");
	            	}
	            	
	            }
	        });
		}else{
			return false;
		}
		return false;
		
	}
	</script>
  </head>
  <body>
	  <div id="login-page">
	  	<div class="container">
		       <form id="beanform" class="form-login" action="#">
		        <h2 class="form-login-heading">登录码客思</h2>
		        <div class="login-wrap">
		           <input type="text" class="form-control" name="tel" id="tel" placeholder="邮箱或者手机号码" autofocus/>
		            <br>
		            <input type="password" class="form-control" name="password" id="password" placeholder="密码">
		            <label class="checkbox">
		                <span class="pull-right">
		                    <a data-toggle="modal" href="${rc.contextPath}/prec">没有账户注册一个</a>
		                    |<a data-toggle="modal" href="login.html#myModal"> 忘记密码?</a>
		
		                </span>
		            </label>
		            <button class="btn btn-theme btn-block" onclick="sublogin()" type="button"><i class="fa fa-lock"></i> 登录</button>
		           	  
		        </div>
		         </form>
		          <!-- Modal -->
		          <div aria-hidden="false" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="myModal" class="modal fade">
		              <div class="modal-dialog">
		                  <div class="modal-content">
		                      <div class="modal-header">
		                          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
		                          <h4 class="modal-title">密码找回？</h4>
		                      </div>
		                      <div class="modal-body">
		                          <p>请输入你的邮箱，系统会已邮件的方式发送密码至你的邮箱</p>
		                          <input type="text" name="email" placeholder="Email" autocomplete="off" class="form-control placeholder-no-fix">
		
		                      </div>
		                      <div class="modal-footer">
		                          <button data-dismiss="modal" class="btn btn-default" type="button">返回</button>
		                          <button class="btn btn-theme" type="button">提交</button>
		                      </div>
		                  </div>
		              </div>
		          </div>
		          <!-- modal -->
		
		     	
	  	
	  	</div>
	  </div>

   


  </body>
</html>
